﻿using System;
using System.Globalization;
using System.Windows.Data;

namespace AWSV2.Converter
{
    public class StringCompareToBoolConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var left = value?.ToString() ?? string.Empty;
            if (parameter is string right)
            {
                return left.Equals(right);
            }
            
            return false;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return parameter;
        }
    }
}

